package com.googlecode.jmicroerp.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author alex
 */
@Entity
@Table(name = "program_lucru")
public class ProgramLucru extends AbstractEntitate {
    private Date zi;
    private Date oraInceput;
    private Date oraSfarsit;
    private Magazin magazin;

    @Column(name = "ZI", unique = true, nullable = false)
    @Temporal(TemporalType.DATE)
    public Date getZi() {
        return zi;
    }

    public void setZi(Date zi) {
        this.zi = zi;
    }

    @Column(name = "ORA_INCEPUT", nullable = false)
    @Temporal(TemporalType.DATE)
    public Date getOraInceput() {
        return oraInceput;
    }

    public void setOraInceput(Date oraInceput) {
        this.oraInceput = oraInceput;
    }

    @Column(name = "ORA_SFARSIT", nullable = false)
    @Temporal(TemporalType.DATE)
    public Date getOraSfarsit() {
        return oraSfarsit;
    }

    public void setOraSfarsit(Date oraSfarsit) {
        this.oraSfarsit = oraSfarsit;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "MAGAZIN_ID")
    public Magazin getMagazin() {
        return magazin;
    }

    public void setMagazin(Magazin magazin) {
        this.magazin = magazin;
    }
}
